<template>
  <div>
    <el-tree :data="list" :props="{label:'name'}" />
    <el-row type="flex" justify="end">
      <el-button type="primary">确定</el-button>
      <el-button type="info">取消</el-button>
    </el-row>
  </div>
</template>

<script>
import { flatToTree } from '@/utils/index'
import { getPermissionList } from '@/api/permisson'
export default {
  data() {
    return {
      list: []

    }
  },
  created() {
    this.loadPermissionList()
  },
  methods: {
    async loadPermissionList() {
      try {
        const res = await getPermissionList()
        console.log('getPermissionList获取权限站点', res)
        // 保存数据
        this.list = flatToTree(res.data)
      } catch (err) {
        console.log('getPermissionList', err)
      }
    }
  }

}
</script>

<style>

</style>
